<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <el-upload
      class="upload-demo"
      drag
      action="http://localhost:8090/uploadTorrent"
      :multiple= "false"
      :on-success= uploadSuccess
      :show-file-list="false">
      <i class="el-icon-upload"></i>
      <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
      <div class="el-upload__tip" slot="tip">只能上传torrent文件</div>
    </el-upload>
    <el-form ref="form" :model="form" label-width="180px">
      <el-form-item label="净化的结果:">
        <el-input v-model="form.result" placeholder="神秘代码"></el-input>
      </el-form-item>
    </el-form>

  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: '黑科技',
      form: {
        result: ''
      }

    }
  },
  created:function(){
    document.title = '黑科技';
  },
  methods:{
    uploadSuccess:function (response, file, fileList) {
     this.form.result=response
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
